using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Presentation
{
    public partial class frmQuanLyDocGia : Form
    {
        string PhanQuyen = "";

        public frmQuanLyDocGia()
        {
            InitializeComponent();
        }
        public frmQuanLyDocGia(string str)
        {
            InitializeComponent();
            PhanQuyen = str;
            if (PhanQuyen == "NV")
            {
                this.btnNhanVien.Visible = false;
                this.lblNhanVien.Visible = false;
                this.btnDocGia.Location = new Point(28, 140);
                this.lblDocGia.Location = new Point(25, 210);
                this.btnDangXuat.Location = new Point(28, 290);
                this.lblDangXuat.Location = new Point(25, 360);
            }
            else
            {
                this.btnNhanVien.Visible = true;
                this.btnNhanVien.Visible = true;
            }
        }            

       
       private void btnThuVien_Click(object sender, EventArgs e)
        {
            frmQuanLythuVien f = new frmQuanLythuVien(PhanQuyen);
            this.Hide();
            f.ShowDialog();
            this.Close();
        }

        private void btnDangXuat_Click(object sender, EventArgs e)
        {
            this.Close();
            frmTimKiem f = new frmTimKiem();
            f.ShowDialog();
        }

        private void btnThemThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnNhanVien_Click(object sender, EventArgs e)
        {
            frmQuanLyNhanVien f = new frmQuanLyNhanVien();
            this.Hide();
            f.ShowDialog();
            this.Close();
        }

        private void frmQuanLyDocGia_Load(object sender, EventArgs e)
        {
            frmTimKiem f = new frmTimKiem();
            if (f.PhanQuyen == "NV")
            {
                this.btnNhanVien.Visible = false;
                
            }
        }

                     
    }
}